import demo1.BookList;
import demo2.AdminUser;
import demo2.NomalUser;
import demo2.User;

import java.util.Scanner;

public class Main {

    public static User fun(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入姓名");
      String name=sc.nextLine();
        System.out.println("请输入您的身份：1->管理员  0->普通用户");
        int choice=sc.nextInt();
        if(choice==1){
          return  new AdminUser(name);
        }else{
            return new NomalUser(name);
        }

    }
    public static void main(String[] args) {
        BookList book=new BookList();
        User user=fun();
        while(true) {
            int choice = user.meau();
            user.doWork(choice, book);
        }
    }
}